package com.yzs.controller.front;

import com.yzs.common.bean.R;
import com.yzs.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("/order")
public class OrderFrontController {
    @Autowired
    IOrderService os;
    @RequestMapping("createOrder")
    public R createOrder(@RequestParam String hId,@RequestParam(required = false,defaultValue = "-1") Integer sId,@RequestParam Integer bId,@RequestParam(required = false,defaultValue = "-1") Integer aId){
        return os.createOrder(hId, sId, bId, aId);
    }

    @RequestMapping("getMyOrder")
    public R getMyOrder(@RequestParam Integer id){
        return os.getMyOrder(id);
    }

    @RequestMapping("getMySaleOrder")
    public R getMySaleOrder(@RequestParam Integer id){
        return os.getMySaleOrder(id);
    }

    @RequestMapping("nextStep")
    public R nextStep(@RequestParam String oId,@RequestParam Integer step){
        return os.nextStep(oId,step);
    }
}
